import { defineComponent } from "vue";

export default defineComponent({
  data() {
    return {
      x: 0,
      y: 0,
    };
  },

  mounted() {
    document.addEventListener("mousemove", this.handleUpdate);

    (this as any).text = "芜湖芜湖";
  },

  beforeUnmount() {
    document.removeEventListener("mousemove", this.handleUpdate);
  },

  methods: {
    handleUpdate(e: MouseEvent) {
      this.x = e.pageX;
      this.y = e.pageY;
    },
  },
});
